package com.ytsky.quotesystem.service.impl;

import com.github.pagehelper.PageInfo;
import com.ytsky.quotesystem.dao.ArticleMapper;
import com.ytsky.quotesystem.entity.Article;
import com.ytsky.quotesystem.service.ArticleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ArticleServiceImpl implements ArticleService {

    @Autowired
    private ArticleMapper articleMapper;

    /**
     * 返回文章是否发表成功
     * @param article
     * @return
     */
    @Override
    public boolean append(Article article) {
        return articleMapper.insert(article) >0;
    }

    /**
     * 删除文章
     * @param id
     * @return
     */
    @Override
    public boolean remove(int id) {
        return articleMapper.deleteById(id) > 0;
    }

}
